package io.github.eric.urpc.example.example;

import io.github.eric.urpc.example.SimpleClient;
import io.github.eric.urpc.example.SimpleServer;
import io.github.eric.urpc.example.msg.PingRequest;
import io.github.eric.urpc.example.msg.PingResponse;

public class SyncRpcExample {
    public static void main(String[] args) throws Exception {

        SimpleServer simpleServer = new SimpleServer();
        simpleServer.start();

        SimpleClient simpleClient = new SimpleClient();
        simpleClient.connectOnce();

        PingResponse response = simpleClient.getClient().sendSync(new PingRequest());
        System.out.println(response.getRequestId());
    }
}
